package com.mydemo.mybatisdemo1.action;

import com.mydemo.mybatisdemo1.bll.UserService;
import com.mydemo.mybatisdemo1.dto.UserInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping("/say")
    public String say(){
        return "springboot-a"+userService;
    }

    @RequestMapping("/find")
    public String find(){
        UserInfo user =  userService.find(18);

        return "HelloWord"+"fasdf--"+user.getUsername()+"--"+user.getPassword();
    }


    @RequestMapping("/ajax")
    public String find(int id){
        return "[''message':'123dfx']";
    }
}
